#include <p24FJ64GA102.h>
#include "Switch.h"

#define HW_SWITCH_1_GET PORTBbits.RB0
#define HW_SWITCH_2_GET PORTBbits.RB1
#define HW_SWITCH_3_GET PORTBbits.RB2

#define HW_SWITCH_ON 1
#define HW_SWITCH_OFF 0

static SwitchFlags Switches_get(void);

SwitchFunctions Switches = {
	Switches_get,
};

static SwitchFlags Switches_get(void) {
	SwitchFlags flags = SWITCH_NONE;

	flags |= (HW_SWITCH_1_GET == HW_SWITCH_ON ? SWITCH_1 : SWITCH_NONE);
	flags |= (HW_SWITCH_2_GET == HW_SWITCH_ON ? SWITCH_2 : SWITCH_NONE);
	flags |= (HW_SWITCH_3_GET == HW_SWITCH_ON ? SWITCH_3 : SWITCH_NONE);

	return flags;
}
